﻿using Newtonsoft.Json;

namespace DayDayUp.Core.Helper
{
    public class JsonHelper
    {
        public static string ToJson(object obj)
        {
            return JsonConvert.SerializeObject(obj);

            //var json = new JavaScriptSerializer().Serialize(obj);
            //return json;
        }

        public static T ToObject<T>(string json)
        {
            return JsonConvert.DeserializeObject<T>(json);

            // var obj= new JavaScriptSerializer().Deserialize<T>(json);
            //return obj;
        }
    }
}